<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function getCurDate() {
				var d = new Date();
				var years = d.getFullYear();
				var month = add_zero(d.getMonth() + 1);
				var days = add_zero(d.getDate());
				var hours = add_zero(d.getHours());
				var minutes = add_zero(d.getMinutes());
				var seconds = add_zero(d.getSeconds());
				var ndate = years + "年" + month + "月" + days + "日 " + hours + ":" + minutes + ":" + seconds;
				divT.innerHTML = ndate;
			}

			function add_zero(temp) {
				if (temp < 10) {
					return "0" + temp;
				} else {
					return temp;
				}
			}
			setInterval("getCurDate()", 100);
		</script>

		当前时间：<div id="divT"></div>

	</body>
</html>
